package JavaBase.Polymorphism;

public class Shape_Test {
    public static void main(String[] args) {
        Shape shape;
        shape=new Rectangle(3.2,2.4);
        if(shape instanceof Rectangle) {
            Rectangle rectangle = (Rectangle) shape;
            shape.area();
        }
        shape=new Circle(3.2);
        if(shape instanceof Circle)
        {
            Circle circle=(Circle)shape;
            circle.area();
        }

    }
}
